import { defineStore } from 'pinia';

export const useCounterStore = defineStore('counter', {
	state: () => {
		return {
			mode: true,
		 };
	},
	getters:{
		
	},
	actions: {
		//昼夜模式切换
		isMode(){
			this.mode = !this.mode;
			// plus.nativeUI.setUIStyle('dark');
			// plus.nativeUI.setUIStyle(this.mode?'light':'dark');
			  // 此处监听也是监听的的app主题信息，不是手机系统的主题
			 //  uni.onThemeChange(({ theme }) => {
				// console.log('onThemeChange', theme)
			 //  });
		}
	},
});